1. Field of the Invention
This invention relates generally to the field of computer graphics displays, and more particularly to antialiasing of specular highlights on bump mapped textures in a computer graphics display.
2. State of the Art
Computers have been used for many years to do image and graphics generation. In recent years computer generated graphics have become more and more sophisticated, and as the power of computer equipment has increased, users expectations of what the computer should do have also increased. Computer users have come to expect more realism in the graphics which generally means that there are more objects, and more light and texture processing on those objects.
Complex images and scenes are mathematically modeled in three-dimensional space in the computer memory and manipulated accordingly. These three-dimensional mathematical models are called wire frames because all the edges of the object are visible at the same time when displayed. Three-dimensional models are made to look more realistic by removing the edges which should be hidden and by applying color and shading to the visible surfaces of the model. Texture also improves a simple polygon model by adding opacity and color variations. Textures are essentially the application of a photographic or drawn pattern onto the object model to make it look more realistic. These textures usually consist of patterns such as rock, cloth, bark, gravel, or any other imaginable type of texture or picture.
As is well known, basic computer images are formed with thousands of points or pixels on a graphic display. Each pixel is a square physical display unit having a particular shade and color that a computer generates on the graphic display screen. By manipulating large numbers of pixels, patterns emerge to form an identifiable picture.
Textures are very useful when making modeled objects seem more realistic but the illusion breaks down when the texture is intended to show shape variations, such as bumps, on the object because the illumination effects are fixed into the texture. This is similar to rotating a painting in a real light source, the painting""s light and shadow remain as they were originally painted no matter how the real light source moves. When a modeled object rotates, the texture cannot show real time shading on the texturized surfaces of the objects. The solution to this problem is to use bump mapped textures to affect the appearance of a surface by modifying its surface orientation, pixel by pixel, prior to the application of the illumination model.
To create the illusion of bumps, a bump texture map contains values for each texel, that define the local xe2x80x9ctipxe2x80x9d or xe2x80x9ctiltxe2x80x9d which is applied to the instantaneous surface normal. There are two signed values associated with each bump texel to define the forward or backward tilt in each of the two texture directions. These bump texture directions are the U and V texture directions of which are cotangent with the bump maps normal plane as shown in FIG. 1.
FIGS. 2a)-e) shows how bump tilt values are derived and then used to reconstruct the appearance of the bump when the bump texture is applied to a flat polygon. A bump is created by processing height values in a height map, defined momentarily, into local tilt values, usually by computing local height differences in the two map directions (only one direction is shown in FIG. 2). A height map is a texture map which includes values to define the height of each texel.
Computer image generation technology has advanced enough to allow the cost-effective addition of bump maps to the existing toolbox of shading and illumination features. Bump texture supplies the same apparent surface shape detail that would otherwise require thousands or millions of pixel-size polygons by operating through the illumination and shading process.
When this tilted surface normal vector is used in the illumination calculations, the perturbations applied to it by the bump texture cause variations in shading. These variations affect the diffuse and specular (reflective) illumination calculations, and create a compelling illusion of surface bumpiness. The illusion turns out remarkably well because the texture causes a well-behaved, spatially stable, coherent modification of the pixel-by-pixel surface orientation, much like using actual polygons to model bumps. As the surface, the observer, or the lights move about, the resultant shading changes are accurate portrayals of a solid underlying physical model. The illusion is so compelling that the viewer usually ignores the lack of silhouette roughness in bump-mapped objects.
Like other textures, bump texture can cause distracting image artifacts like crawling and flickering if texels are skipped over during the pixel computation process. Texels can be skipped when a texture with a high level of detail is compressed so it can be viewed as though it were farther away. Bump maps, like other textures, utilize the MIP mapping technique of switching between low- and high-resolution versions of the same texture depending on the viewer""s distance from the object, to reduce the jagged aliasing effect. As shown in FIG. 3, MIP maps have a succession of coarser levels of detail which are selected as needed to ensure that no texels are skipped over.
The MIP process is the first line of defense in antialiasing bump texture. Unfortunately, bump texture aliasing during shading has no counterpart in regular texture and it is not well controlled by the MIP process. Shading involves computing and adding highlights and shading after texture has been applied to the image to achieve greater realism. When bump texture is used with specular shading, the specular illumination term creates a bright highlight whose size is partly determined by the surface material""s specular exponent and the surface curvature.
The specular highlight is the reflection of the light source by the surface, and the specular exponent controls the shininess of the surface, and hence the size of the highlight. When a shiny surface is decorated with a bump texture, each bump becomes a curved xe2x80x9cmirrorxe2x80x9d that potentially reflects a small specular highlight. The size of a specular highlight can be many times smaller than the bump that reflects it, so forcing bump texels to be larger than a pixel does not insure that the specular highlights will be larger than a pixel. When a specular highlight gets smaller than a pixel, it gets intermittently skipped over during the rendering process because the shading equation is evaluated only at the center of the pixel and so the visual effect is distracting crawling and flickering.
The flickering and sparkling effect is increased by the movement of the viewer because as the pixel normal moves in relation to the viewer, the specular highlight moves twice as fast across a pixel surface and flickers even more. This effect is due to the symmetrical reflection of light rays. As the pixel normal moves in relation to the viewer, the reflection ray is affected twice as much.
The rigorous solution is to oversample the pixel, perhaps at 16 or more positions in the mathematical model, and average the illumination results to calculate the display pixel. This requires 16 copies of the data to be stored in the computer hardware to evaluate the illumination model. This method is also a computationally intensive process that involves significant vector arithmetic and several exponentiations. Further, this method must be replicated for each additional light source that the system wants to handle in real time. Even with 16 samples, the result would still flicker significantly.
In essence, the bump map aliasing problem is caused by high surface curvature at small points of just a few texels. This is not unlike a small hemispherical mirror which tends to shrink or concentrate a reflection. The bumped texels create mirrors with high gain factors and cause extreme shrinkage of the specular highlight. What is needed is a sophisticated process that yields a realistic image with proper specular highlights but does not increase the hardware needed or require intensive calculations for the antialiasing process.
It is an object of the invention to provide a system for decreasing the brightness of the specular highlights in a well behaved way to control the highlight aliasing.
It is another object of the invention to provide a system for antialiasing with a minimum of object sampling to reduce the amount of hardware required for bump map antialiasing.
It is a further object of this invention to provide a system which eliminates or reduces flickering, crawling, sparkling, or other artifacts in the graphic representation which are a result of bump mapping.
It is also an object of the invention to provide a system for bump antialiasing which is not computationally intensive.
The above and other objects are realized by the present invention, disclosed in a specific illustrative embodiment of a system which utilizes a bump curvature value which is computed by the difference in tilt between adjacent bump texels. The bump curvature value determines an xe2x80x9cintegration windowxe2x80x9d or integration space over the specular highlight on the bump. The process of the present invention determines the approximate sum of the specular rays across the bump and averages the rays. The resulting value is added to the shading value of the pixel, so that the pixel value is an average specular brightness instead of flickering when the specular reflection hits the center of the pixel. This approximation reduces the brightness of the highlights and includes increasing the brightness near the highlights, in a user-controlled blend that preserves the proper average effect of the specularity.